# -*- coding: UTF-8 -*-
from avanzaweb.models import Promocion
from django import forms

# Nuevo widget campo de fecha para manejar fechas europeas
class CampoFecha(forms.DateInput):
     #~ class Media:
          #~ js = ('/site_media/js/jquery-ui-1.7.2.custom.min.js', '/site_media/js/calendario.js')

     def __init__(self, attrs={}, format=None):
          super(CampoFecha, self).__init__(attrs={'class': 'vDateField', 'size': '10'}, format = "%d/%m/%Y")

#~ Formularios
class PromoForm (forms.ModelForm):
     #~ descripcion = forms.CharField(widget=TinyMCE(attrs={'cols': 40, 'rows': 10}))
     #~ memoria = forms.CharField(widget=TinyMCE(attrs={'cols': 40, 'rows': 10}))
     fecha = forms.DateField(('%d/%m/%Y',), label='Fecha', required=True,  widget=CampoFecha())
     
     class Meta:
          model = Promocion
          exclude = ('orden',)

